pub mod macros_func;
pub mod singleton;
pub mod str_utils;
pub mod thread_pool;
mod sqlite_utils;

pub use self::macros_func::type_of_val;
pub use crate::utils::thread_pool::time_cost;
pub use crate::utils::thread_pool::SimplePool;
use std::fs::{create_dir_all, File, OpenOptions};
use std::path::PathBuf;
pub use str_utils::*;
// pub use crate::utils::macros_func::GetStatic;

pub fn create_new_file(dir: &str, file: &str) -> File {
    let mut dir_buf = PathBuf::from(dir);
    if !dir_buf.exists() {
        create_dir_all(dir_buf.as_path()).expect("创建文件夹失败！");
    }
    File::create(dir_buf.join(file)).unwrap();
    OpenOptions::new()
        .read(true)
        .write(true)
        .create(true)
        .append(true)
        .open(dir_buf.join(file))
        .unwrap()
}
